home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
wp
/
thedjg22.zip
/
RM.THE
< prev
next >
Wrap
Text File
|
1996-05-26
|
2KB
|
63 lines
/*
$Id: rm.the 2.1 1995/06/24 16:31:10 MH Rel MH $
*/
/***********************************************************************/
/* Description: REXX macro to delete a file from a DIR.DIR file. */
/* Syntax: */
/* Notes: This macro deletes the line from the DIR.DIR file and */
/* the actual file from disk. */
/* Use with caution. */
/***********************************************************************/
Trace o
'EXTRACT /TOF/EOF/VERSION/DIRFILEID/CURLINE/' /* get various stuff */
If rc \= 0 Then
Do
Say 'Error in EXTRACT:' rc
Exit 1
End
If \dir() Then
Do
'emsg ERROR: rm.the can only be run from the DIR.DIR file'
Exit 1
End
If \modifiable() Then
Do
'emsg ERROR: invalid cursor position'
Exit 1
End
If version.2 = '1.5' Then oncommand = command()
Else oncommand = incommand()
If oncommand Then
Do
If tof.1 = 'ON' | eof.1 = 'ON' Then
Do
'emsg ERROR: cannot delete TOF or EOF line'
Exit 1
End
End
Select
When version.3 = 'UNIX' & Substr(curline.3,1,1) = 'd' Then
Do
'emsg ERROR: cannot delete directories'
Exit 1
End
When version.3 = 'DOS' & Substr(curline.3,6,3) = 'dir' Then
Do
'emsg ERROR: cannot delete directories'
Exit 1
End
When version.3 = 'OS2' & Substr(curline.3,6,3) = 'dir' Then
Do
'emsg ERROR: cannot delete directories'
Exit 1
End
Otherwise Nop
End
If version.3 = 'UNIX' Then delcmd = 'osq rm -f'
Else delcmd = 'osq del'
'sos delline'
filename = dirfileid.1||dirfileid.2
delcmd filename
'msg File' filename 'deleted'
Return 0